<template>
  <div>
    测试mock加成下的select效果
    <el-select v-model="value" placeholder="请选择">
      <el-option
        v-for="item in options"
        :key="item.value"
        :label="item.label"
        :value="item.value">
      </el-option>
    </el-select>
  </div>
</template>

<script>
  export default {
    name:'testSelect',
    data() {
      return {
        options: [{label:'默认值',value:0}],
        value: ''
      }
    },
    methods:{
      initOptions:function(array){
        array.forEach((v,i)=>{
          this.options.push(v)
        })
      },
    },
    mounted: function() {
      this.$axios.get('/testOptions').then((res)=>{
        this.initOptions(res.data)
      })
    },
  }
</script>

<style>

</style>